.class public Lcom/viewpagerindicator/TabMovablePageIndicator;
.super Landroid/widget/HorizontalScrollView;
.source "TabMovablePageIndicator.java"

# interfaces
.implements Lcom/viewpagerindicator/PageIndicator;


# annotations
.annotation build Landroid/annotation/SuppressLint;
    value = {
        "NewApi"
    }
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;,
        Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;
    }
.end annotation


# static fields
.field private static final EMPTY_TITLE:Ljava/lang/CharSequence;


# instance fields
.field private isTabAllDisplay:Z

.field private mExtendWidth:I

.field private final mIndicator:Landroid/widget/ImageView;

.field private mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

.field private final mMainBox:Landroid/widget/LinearLayout;

.field private mMaxTabWidth:I

.field private mPaddingEachEdge:I

.field private mScreenWidth:I

.field private mSelectedTabIndex:I

.field private final mTabClickListener:Landroid/view/View$OnClickListener;

.field private final mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

.field private mTabReselectedListener:Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;

.field private mTabSelector:Ljava/lang/Runnable;

.field private mViewPager:Landroid/support/v4/view/ViewPager;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 57
    const-string v0, ""

    sput-object v0, Lcom/viewpagerindicator/TabMovablePageIndicator;->EMPTY_TITLE:Ljava/lang/CharSequence;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 99
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lcom/viewpagerindicator/TabMovablePageIndicator;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 100
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getScreenDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->widthPixels:I

    iput v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mScreenWidth:I

    .line 101
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .registers 10
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    const/4 v6, -0x1

    const/4 v5, -0x2

    .line 104
    invoke-direct {p0, p1, p2}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 73
    new-instance v1, Lcom/viewpagerindicator/TabMovablePageIndicator$1;

    invoke-direct {v1, p0}, Lcom/viewpagerindicator/TabMovablePageIndicator$1;-><init>(Lcom/viewpagerindicator/TabMovablePageIndicator;)V

    iput-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabClickListener:Landroid/view/View$OnClickListener;

    .line 105
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getScreenDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v1

    iget v1, v1, Landroid/util/DisplayMetrics;->widthPixels:I

    iput v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mScreenWidth:I

    .line 106
    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setHorizontalScrollBarEnabled(Z)V

    .line 108
    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    .line 109
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 110
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    new-instance v2, Landroid/view/ViewGroup$LayoutParams;

    invoke-direct {v2, v5, v6}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 112
    new-instance v1, Lcom/viewpagerindicator/IcsLinearLayout;

    sget v2, Lcom/viewpagerindicator/R$attr;->vpiTabPageIndicatorStyle:I

    invoke-direct {v1, p1, v2}, Lcom/viewpagerindicator/IcsLinearLayout;-><init>(Landroid/content/Context;I)V

    iput-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    .line 113
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    iget-object v2, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/high16 v4, 0x3f800000

    invoke-direct {v3, v5, v6, v4}, Landroid/widget/LinearLayout$LayoutParams;-><init>(IIF)V

    invoke-virtual {v1, v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 115
    new-instance v1, Landroid/widget/ImageView;

    invoke-direct {v1, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    .line 116
    new-instance v0, Landroid/widget/LinearLayout$LayoutParams;

    invoke-direct {v0, v5, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 117
    .local v0, "indicatorLp":Landroid/widget/LinearLayout$LayoutParams;
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    iget-object v2, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v1, v2, v0}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 119
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMainBox:Landroid/widget/LinearLayout;

    new-instance v2, Landroid/view/ViewGroup$LayoutParams;

    invoke-direct {v2, v5, v6}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {p0, v1, v2}, Lcom/viewpagerindicator/TabMovablePageIndicator;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 120
    return-void
.end method

.method static synthetic access$000(Lcom/viewpagerindicator/TabMovablePageIndicator;)Landroid/support/v4/view/ViewPager;
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    return-object v0
.end method

.method static synthetic access$100(Lcom/viewpagerindicator/TabMovablePageIndicator;)Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabReselectedListener:Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;

    return-object v0
.end method

.method static synthetic access$1000(Lcom/viewpagerindicator/TabMovablePageIndicator;)I
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mPaddingEachEdge:I

    return v0
.end method

.method static synthetic access$1100(Lcom/viewpagerindicator/TabMovablePageIndicator;)I
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mExtendWidth:I

    return v0
.end method

.method static synthetic access$200(Lcom/viewpagerindicator/TabMovablePageIndicator;Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)V
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;
    .param p1, "x1"    # Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;

    .prologue
    .line 55
    invoke-direct {p0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->animateScrollWithIndicator(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)V

    return-void
.end method

.method static synthetic access$300(Lcom/viewpagerindicator/TabMovablePageIndicator;Landroid/widget/TextView;)V
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;
    .param p1, "x1"    # Landroid/widget/TextView;

    .prologue
    .line 55
    invoke-direct {p0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->moveIndicator(Landroid/widget/TextView;)V

    return-void
.end method

.method static synthetic access$402(Lcom/viewpagerindicator/TabMovablePageIndicator;Ljava/lang/Runnable;)Ljava/lang/Runnable;
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;
    .param p1, "x1"    # Ljava/lang/Runnable;

    .prologue
    .line 55
    iput-object p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    return-object p1
.end method

.method static synthetic access$600(Lcom/viewpagerindicator/TabMovablePageIndicator;)Landroid/widget/ImageView;
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$800(Lcom/viewpagerindicator/TabMovablePageIndicator;)Z
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget-boolean v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->isTabAllDisplay:Z

    return v0
.end method

.method static synthetic access$900(Lcom/viewpagerindicator/TabMovablePageIndicator;)I
    .registers 2
    .param p0, "x0"    # Lcom/viewpagerindicator/TabMovablePageIndicator;

    .prologue
    .line 55
    iget v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMaxTabWidth:I

    return v0
.end method

.method private addTab(ILjava/lang/CharSequence;I)Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;
    .registers 11
    .param p1, "index"    # I
    .param p2, "text"    # Ljava/lang/CharSequence;
    .param p3, "iconResId"    # I

    .prologue
    const/4 v6, 0x0

    .line 282
    new-instance v0, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;

    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v0, p0, v2}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;-><init>(Lcom/viewpagerindicator/TabMovablePageIndicator;Landroid/content/Context;)V

    .line 283
    .local v0, "tabView":Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;
    # setter for: Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->mIndex:I
    invoke-static {v0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->access$702(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;I)I

    .line 284
    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->setFocusable(Z)V

    .line 285
    iget-object v2, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabClickListener:Landroid/view/View$OnClickListener;

    invoke-virtual {v0, v2}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 286
    invoke-virtual {v0, p2}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->setText(Ljava/lang/CharSequence;)V

    .line 288
    if-eqz p3, :cond_1e

    .line 289
    invoke-virtual {v0, p3, v6, v6, v6}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->setCompoundDrawablesWithIntrinsicBounds(IIII)V

    .line 292
    :cond_1e
    iget-object v2, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    new-instance v3, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v4, -0x1

    const/high16 v5, 0x3f800000

    invoke-direct {v3, v6, v4, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(IIF)V

    invoke-virtual {v2, v0, v3}, Lcom/viewpagerindicator/IcsLinearLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 293
    invoke-interface {p2}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->getTextSize()F

    move-result v3

    invoke-virtual {v0}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->getTypeface()Landroid/graphics/Typeface;

    move-result-object v4

    invoke-static {v2, v3, v4}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getTextWidth(Ljava/lang/String;FLandroid/graphics/Typeface;)I

    move-result v1

    .line 294
    .local v1, "width":I
    # setter for: Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->wordWidth:I
    invoke-static {v0, v1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->access$502(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;I)I

    .line 296
    return-object v0
.end method

.method private animateScrollWithIndicator(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)V
    .registers 16
    .param p1, "tabView"    # Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;

    .prologue
    const/4 v13, 0x1

    const/4 v12, 0x0

    .line 192
    invoke-virtual {p1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->getLeft()I

    move-result v8

    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getWidth()I

    move-result v9

    invoke-virtual {p1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->getWidth()I

    move-result v10

    sub-int/2addr v9, v10

    div-int/lit8 v9, v9, 0x2

    sub-int v5, v8, v9

    .line 194
    .local v5, "scrollPos":I
    new-instance v3, Landroid/animation/AnimatorSet;

    invoke-direct {v3}, Landroid/animation/AnimatorSet;-><init>()V

    .line 195
    .local v3, "as":Landroid/animation/AnimatorSet;
    const-wide/16 v8, 0x12c

    invoke-virtual {v3, v8, v9}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;

    .line 197
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 200
    .local v2, "animations":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator;>;"
    const-string v8, "scrollX"

    new-array v9, v13, [I

    aput v5, v9, v12

    invoke-static {p0, v8, v9}, Landroid/animation/ObjectAnimator;->ofInt(Ljava/lang/Object;Ljava/lang/String;[I)Landroid/animation/ObjectAnimator;

    move-result-object v0

    .line 201
    .local v0, "animScrollX":Landroid/animation/ObjectAnimator;
    new-instance v8, Landroid/view/animation/AccelerateDecelerateInterpolator;

    invoke-direct {v8}, Landroid/view/animation/AccelerateDecelerateInterpolator;-><init>()V

    invoke-virtual {v0, v8}, Landroid/animation/ObjectAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)V

    .line 202
    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 205
    invoke-virtual {p1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->getLeft()I

    move-result v4

    .line 207
    .local v4, "left":I
    # getter for: Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->wordWidth:I
    invoke-static {p1}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->access$500(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)I

    move-result v6

    .line 211
    .local v6, "textWidth":I
    iget-object v8, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    const-string v9, "translationX"

    new-array v10, v13, [F

    int-to-float v11, v4

    aput v11, v10, v12

    invoke-static {v8, v9, v10}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v7

    .line 212
    .local v7, "translateXAnim":Landroid/animation/ObjectAnimator;
    new-instance v8, Landroid/view/animation/OvershootInterpolator;

    const v9, 0x3f4ccccd

    invoke-direct {v8, v9}, Landroid/view/animation/OvershootInterpolator;-><init>(F)V

    invoke-virtual {v7, v8}, Landroid/animation/ObjectAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)V

    .line 213
    invoke-virtual {v2, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 216
    const/4 v8, 0x2

    new-array v8, v8, [I

    iget-object v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v9}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v9

    iget v9, v9, Landroid/view/ViewGroup$LayoutParams;->width:I

    aput v9, v8, v12

    iget v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mExtendWidth:I

    mul-int/lit8 v9, v9, 0x2

    add-int/2addr v9, v6

    aput v9, v8, v13

    invoke-static {v8}, Landroid/animation/ValueAnimator;->ofInt([I)Landroid/animation/ValueAnimator;

    move-result-object v1

    .line 217
    .local v1, "animWidth":Landroid/animation/ValueAnimator;
    new-instance v8, Lcom/viewpagerindicator/TabMovablePageIndicator$3;

    invoke-direct {v8, p0}, Lcom/viewpagerindicator/TabMovablePageIndicator$3;-><init>(Lcom/viewpagerindicator/TabMovablePageIndicator;)V

    invoke-virtual {v1, v8}, Landroid/animation/ValueAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V

    .line 228
    invoke-virtual {v2, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 230
    invoke-virtual {v3, v2}, Landroid/animation/AnimatorSet;->playTogether(Ljava/util/Collection;)V

    .line 231
    invoke-virtual {v3}, Landroid/animation/AnimatorSet;->start()V

    .line 232
    return-void
.end method

.method private animateToTab(I)V
    .registers 4
    .param p1, "position"    # I

    .prologue
    .line 171
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    invoke-virtual {v1, p1}, Lcom/viewpagerindicator/IcsLinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;

    .line 172
    .local v0, "tabView":Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    if-eqz v1, :cond_11

    .line 173
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    invoke-virtual {p0, v1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->removeCallbacks(Ljava/lang/Runnable;)Z

    .line 175
    :cond_11
    new-instance v1, Lcom/viewpagerindicator/TabMovablePageIndicator$2;

    invoke-direct {v1, p0, v0}, Lcom/viewpagerindicator/TabMovablePageIndicator$2;-><init>(Lcom/viewpagerindicator/TabMovablePageIndicator;Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)V

    iput-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    .line 188
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    invoke-virtual {p0, v1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->post(Ljava/lang/Runnable;)Z

    .line 189
    return-void
.end method

.method public static getTextWidth(Ljava/lang/String;FLandroid/graphics/Typeface;)I
    .registers 7
    .param p0, "str"    # Ljava/lang/String;
    .param p1, "fontSize"    # F
    .param p2, "typeface"    # Landroid/graphics/Typeface;

    .prologue
    const/4 v2, 0x0

    .line 247
    if-eqz p0, :cond_b

    const-string v3, ""

    invoke-virtual {p0, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_c

    .line 255
    :cond_b
    :goto_b
    return v2

    .line 250
    :cond_c
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    .line 251
    .local v0, "pFont":Landroid/graphics/Paint;
    new-instance v1, Landroid/graphics/Rect;

    invoke-direct {v1}, Landroid/graphics/Rect;-><init>()V

    .line 252
    .local v1, "rect":Landroid/graphics/Rect;
    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setTextSize(F)V

    .line 253
    invoke-virtual {v0, p2}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    .line 254
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {v0, p0, v2, v3, v1}, Landroid/graphics/Paint;->getTextBounds(Ljava/lang/String;IILandroid/graphics/Rect;)V

    .line 255
    invoke-virtual {v1}, Landroid/graphics/Rect;->width()I

    move-result v2

    goto :goto_b
.end method

.method private moveIndicator(Landroid/widget/TextView;)V
    .registers 10
    .param p1, "tabView"    # Landroid/widget/TextView;

    .prologue
    .line 235
    invoke-virtual {p1}, Landroid/widget/TextView;->getLeft()I

    move-result v0

    .line 236
    .local v0, "left":I
    invoke-virtual {p1}, Landroid/widget/TextView;->getWidth()I

    move-result v3

    .line 237
    .local v3, "width":I
    invoke-virtual {p1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

    move-result-object v5

    invoke-interface {v5}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {p1}, Landroid/widget/TextView;->getTextSize()F

    move-result v6

    invoke-virtual {p1}, Landroid/widget/TextView;->getTypeface()Landroid/graphics/Typeface;

    move-result-object v7

    invoke-static {v5, v6, v7}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getTextWidth(Ljava/lang/String;FLandroid/graphics/Typeface;)I

    move-result v2

    .line 239
    .local v2, "textWidth":I
    sub-int v5, v3, v2

    div-int/lit8 v5, v5, 0x2

    add-int v4, v0, v5

    .line 241
    .local v4, "x":I
    new-instance v1, Landroid/widget/LinearLayout$LayoutParams;

    iget-object v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v5}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v5

    iget v5, v5, Landroid/view/ViewGroup$LayoutParams;->height:I

    invoke-direct {v1, v2, v5}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 242
    .local v1, "lp":Landroid/widget/LinearLayout$LayoutParams;
    iput v4, v1, Landroid/widget/LinearLayout$LayoutParams;->leftMargin:I

    .line 243
    iget-object v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v5, v1}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 244
    return-void
.end method


# virtual methods
.method protected getScreenDisplayMetrics()Landroid/util/DisplayMetrics;
    .registers 3

    .prologue
    .line 259
    new-instance v0, Landroid/util/DisplayMetrics;

    invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V

    .line 260
    .local v0, "dm":Landroid/util/DisplayMetrics;
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getContext()Landroid/content/Context;

    move-result-object v1

    check-cast v1, Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager;

    move-result-object v1

    invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

    .line 261
    return-object v0
.end method

.method public notifyDataSetChanged()V
    .registers 11

    .prologue
    .line 339
    iget-object v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    invoke-virtual {v9}, Lcom/viewpagerindicator/IcsLinearLayout;->removeAllViews()V

    .line 340
    iget-object v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    invoke-virtual {v9}, Landroid/support/v4/view/ViewPager;->getAdapter()Landroid/support/v4/view/PagerAdapter;

    move-result-object v0

    .line 341
    .local v0, "adapter":Landroid/support/v4/view/PagerAdapter;
    const/4 v3, 0x0

    .line 342
    .local v3, "iconAdapter":Lcom/viewpagerindicator/IconPagerAdapter;
    instance-of v9, v0, Lcom/viewpagerindicator/IconPagerAdapter;

    if-eqz v9, :cond_13

    move-object v3, v0

    .line 343
    check-cast v3, Lcom/viewpagerindicator/IconPagerAdapter;

    .line 345
    :cond_13
    invoke-virtual {v0}, Landroid/support/v4/view/PagerAdapter;->getCount()I

    move-result v1

    .line 347
    .local v1, "count":I
    const/4 v8, 0x0

    .line 348
    .local v8, "wordsTotalWidth":I
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_19
    if-ge v2, v1, :cond_36

    .line 349
    invoke-virtual {v0, v2}, Landroid/support/v4/view/PagerAdapter;->getPageTitle(I)Ljava/lang/CharSequence;

    move-result-object v6

    .line 350
    .local v6, "title":Ljava/lang/CharSequence;
    if-nez v6, :cond_23

    .line 351
    sget-object v6, Lcom/viewpagerindicator/TabMovablePageIndicator;->EMPTY_TITLE:Ljava/lang/CharSequence;

    .line 353
    :cond_23
    const/4 v4, 0x0

    .line 354
    .local v4, "iconResId":I
    if-eqz v3, :cond_2a

    .line 355
    invoke-interface {v3, v2}, Lcom/viewpagerindicator/IconPagerAdapter;->getIconResId(I)I

    move-result v4

    .line 357
    :cond_2a
    invoke-direct {p0, v2, v6, v4}, Lcom/viewpagerindicator/TabMovablePageIndicator;->addTab(ILjava/lang/CharSequence;I)Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;

    move-result-object v5

    .line 358
    .local v5, "tabView":Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;
    # getter for: Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->wordWidth:I
    invoke-static {v5}, Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;->access$500(Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;)I

    move-result v9

    add-int/2addr v8, v9

    .line 348
    add-int/lit8 v2, v2, 0x1

    goto :goto_19

    .line 361
    .end local v4    # "iconResId":I
    .end local v5    # "tabView":Lcom/viewpagerindicator/TabMovablePageIndicator$TabView;
    .end local v6    # "title":Ljava/lang/CharSequence;
    :cond_36
    iget-boolean v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->isTabAllDisplay:Z

    if-eqz v9, :cond_43

    .line 362
    iget v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mScreenWidth:I

    sub-int v7, v9, v8

    .line 363
    .local v7, "totalSpace":I
    if-gez v7, :cond_54

    .line 364
    const/4 v9, 0x0

    iput v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mPaddingEachEdge:I

    .line 370
    .end local v7    # "totalSpace":I
    :cond_43
    :goto_43
    iget v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mSelectedTabIndex:I

    if-le v9, v1, :cond_4b

    .line 371
    add-int/lit8 v9, v1, -0x1

    iput v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mSelectedTabIndex:I

    .line 373
    :cond_4b
    iget v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mSelectedTabIndex:I

    invoke-virtual {p0, v9}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setCurrentItem(I)V

    .line 374
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->requestLayout()V

    .line 375
    return-void

    .line 366
    .restart local v7    # "totalSpace":I
    :cond_54
    div-int v9, v7, v1

    div-int/lit8 v9, v9, 0x2

    iput v9, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mPaddingEachEdge:I

    goto :goto_43
.end method

.method public onAttachedToWindow()V
    .registers 2

    .prologue
    .line 266
    invoke-super {p0}, Landroid/widget/HorizontalScrollView;->onAttachedToWindow()V

    .line 267
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    if-eqz v0, :cond_c

    .line 269
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    invoke-virtual {p0, v0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->post(Ljava/lang/Runnable;)Z

    .line 271
    :cond_c
    return-void
.end method

.method public onDetachedFromWindow()V
    .registers 2

    .prologue
    .line 275
    invoke-super {p0}, Landroid/widget/HorizontalScrollView;->onDetachedFromWindow()V

    .line 276
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    if-eqz v0, :cond_c

    .line 277
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabSelector:Ljava/lang/Runnable;

    invoke-virtual {p0, v0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->removeCallbacks(Ljava/lang/Runnable;)Z

    .line 279
    :cond_c
    return-void
.end method

.method public onMeasure(II)V
    .registers 11
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    const/high16 v7, 0x40000000

    const/4 v5, 0x1

    .line 144
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v4

    .line 145
    .local v4, "widthMode":I
    if-ne v4, v7, :cond_3f

    move v1, v5

    .line 146
    .local v1, "lockedExpanded":Z
    :goto_a
    invoke-virtual {p0, v1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setFillViewport(Z)V

    .line 148
    iget-object v6, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    invoke-virtual {v6}, Lcom/viewpagerindicator/IcsLinearLayout;->getChildCount()I

    move-result v0

    .line 149
    .local v0, "childCount":I
    if-le v0, v5, :cond_4a

    if-eq v4, v7, :cond_1b

    const/high16 v5, -0x80000000

    if-ne v4, v5, :cond_4a

    .line 150
    :cond_1b
    const/4 v5, 0x2

    if-le v0, v5, :cond_41

    .line 151
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v5

    int-to-float v5, v5

    const v6, 0x3ecccccd

    mul-float/2addr v5, v6

    float-to-int v5, v5

    iput v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMaxTabWidth:I

    .line 160
    :goto_2a
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getMeasuredWidth()I

    move-result v3

    .line 161
    .local v3, "oldWidth":I
    invoke-super {p0, p1, p2}, Landroid/widget/HorizontalScrollView;->onMeasure(II)V

    .line 162
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->getMeasuredWidth()I

    move-result v2

    .line 164
    .local v2, "newWidth":I
    if-eqz v1, :cond_3e

    if-eq v3, v2, :cond_3e

    .line 166
    iget v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mSelectedTabIndex:I

    invoke-virtual {p0, v5}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setCurrentItem(I)V

    .line 168
    :cond_3e
    return-void

    .line 145
    .end local v0    # "childCount":I
    .end local v1    # "lockedExpanded":Z
    .end local v2    # "newWidth":I
    .end local v3    # "oldWidth":I
    :cond_3f
    const/4 v1, 0x0

    goto :goto_a

    .line 154
    .restart local v0    # "childCount":I
    .restart local v1    # "lockedExpanded":Z
    :cond_41
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v5

    div-int/lit8 v5, v5, 0x2

    iput v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMaxTabWidth:I

    goto :goto_2a

    .line 157
    :cond_4a
    const/4 v5, -0x1

    iput v5, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mMaxTabWidth:I

    goto :goto_2a
.end method

.method public onPageScrollStateChanged(I)V
    .registers 3
    .param p1, "arg0"    # I

    .prologue
    .line 301
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    if-eqz v0, :cond_9

    .line 302
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    invoke-interface {v0, p1}, Landroid/support/v4/view/ViewPager$OnPageChangeListener;->onPageScrollStateChanged(I)V

    .line 304
    :cond_9
    return-void
.end method

.method public onPageScrolled(IFI)V
    .registers 5
    .param p1, "arg0"    # I
    .param p2, "arg1"    # F
    .param p3, "arg2"    # I

    .prologue
    .line 308
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    if-eqz v0, :cond_9

    .line 309
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    invoke-interface {v0, p1, p2, p3}, Landroid/support/v4/view/ViewPager$OnPageChangeListener;->onPageScrolled(IFI)V

    .line 311
    :cond_9
    return-void
.end method

.method public onPageSelected(I)V
    .registers 3
    .param p1, "arg0"    # I

    .prologue
    .line 315
    invoke-virtual {p0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setCurrentItem(I)V

    .line 316
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    if-eqz v0, :cond_c

    .line 317
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    invoke-interface {v0, p1}, Landroid/support/v4/view/ViewPager$OnPageChangeListener;->onPageSelected(I)V

    .line 319
    :cond_c
    return-void
.end method

.method public setCurrentItem(I)V
    .registers 8
    .param p1, "item"    # I

    .prologue
    .line 385
    iget-object v4, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    if-nez v4, :cond_c

    .line 386
    new-instance v4, Ljava/lang/IllegalStateException;

    const-string v5, "ViewPager has not been bound."

    invoke-direct {v4, v5}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 388
    :cond_c
    iput p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mSelectedTabIndex:I

    .line 389
    iget-object v4, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    invoke-virtual {v4, p1}, Landroid/support/v4/view/ViewPager;->setCurrentItem(I)V

    .line 391
    iget-object v4, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    invoke-virtual {v4}, Lcom/viewpagerindicator/IcsLinearLayout;->getChildCount()I

    move-result v3

    .line 392
    .local v3, "tabCount":I
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_1a
    if-ge v1, v3, :cond_32

    .line 393
    iget-object v4, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabLayout:Lcom/viewpagerindicator/IcsLinearLayout;

    invoke-virtual {v4, v1}, Lcom/viewpagerindicator/IcsLinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 394
    .local v0, "child":Landroid/view/View;
    if-ne v1, p1, :cond_30

    const/4 v2, 0x1

    .line 395
    .local v2, "isSelected":Z
    :goto_25
    invoke-virtual {v0, v2}, Landroid/view/View;->setSelected(Z)V

    .line 396
    if-eqz v2, :cond_2d

    .line 397
    invoke-direct {p0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->animateToTab(I)V

    .line 392
    :cond_2d
    add-int/lit8 v1, v1, 0x1

    goto :goto_1a

    .line 394
    .end local v2    # "isSelected":Z
    :cond_30
    const/4 v2, 0x0

    goto :goto_25

    .line 401
    .end local v0    # "child":Landroid/view/View;
    :cond_32
    return-void
.end method

.method public setIndicatorColor(I)V
    .registers 3
    .param p1, "color"    # I

    .prologue
    .line 123
    iget-object v0, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setBackgroundColor(I)V

    .line 124
    return-void
.end method

.method public setIndicatorLayoutParams(II)V
    .registers 6
    .param p1, "height"    # I
    .param p2, "extendWidth"    # I

    .prologue
    .line 127
    iput p2, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mExtendWidth:I

    .line 128
    new-instance v0, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v1, -0x2

    invoke-direct {v0, v1, p1}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 129
    .local v0, "lp":Landroid/widget/LinearLayout$LayoutParams;
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 130
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mIndicator:Landroid/widget/ImageView;

    const/4 v2, 0x4

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 131
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->requestLayout()V

    .line 132
    return-void
.end method

.method public setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V
    .registers 2
    .param p1, "listener"    # Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    .prologue
    .line 405
    iput-object p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mListener:Landroid/support/v4/view/ViewPager$OnPageChangeListener;

    .line 406
    return-void
.end method

.method public setOnTabReselectedListener(Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;)V
    .registers 2
    .param p1, "listener"    # Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;

    .prologue
    .line 139
    iput-object p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mTabReselectedListener:Lcom/viewpagerindicator/TabMovablePageIndicator$OnTabReselectedListener;

    .line 140
    return-void
.end method

.method public setTabAllDisplay(Z)V
    .registers 2
    .param p1, "isTabAllDisplay"    # Z

    .prologue
    .line 135
    iput-boolean p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->isTabAllDisplay:Z

    .line 136
    return-void
.end method

.method public setViewPager(Landroid/support/v4/view/ViewPager;)V
    .registers 5
    .param p1, "view"    # Landroid/support/v4/view/ViewPager;

    .prologue
    .line 323
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    if-ne v1, p1, :cond_5

    .line 336
    :goto_4
    return-void

    .line 326
    :cond_5
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    if-eqz v1, :cond_f

    .line 327
    iget-object v1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/support/v4/view/ViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    .line 329
    :cond_f
    invoke-virtual {p1}, Landroid/support/v4/view/ViewPager;->getAdapter()Landroid/support/v4/view/PagerAdapter;

    move-result-object v0

    .line 330
    .local v0, "adapter":Landroid/support/v4/view/PagerAdapter;
    if-nez v0, :cond_1d

    .line 331
    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "ViewPager does not have adapter instance."

    invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v1

    .line 333
    :cond_1d
    iput-object p1, p0, Lcom/viewpagerindicator/TabMovablePageIndicator;->mViewPager:Landroid/support/v4/view/ViewPager;

    .line 334
    invoke-virtual {p1, p0}, Landroid/support/v4/view/ViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    .line 335
    invoke-virtual {p0}, Lcom/viewpagerindicator/TabMovablePageIndicator;->notifyDataSetChanged()V

    goto :goto_4
.end method

.method public setViewPager(Landroid/support/v4/view/ViewPager;I)V
    .registers 3
    .param p1, "view"    # Landroid/support/v4/view/ViewPager;
    .param p2, "initialPosition"    # I

    .prologue
    .line 379
    invoke-virtual {p0, p1}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setViewPager(Landroid/support/v4/view/ViewPager;)V

    .line 380
    invoke-virtual {p0, p2}, Lcom/viewpagerindicator/TabMovablePageIndicator;->setCurrentItem(I)V

    .line 381
    return-void
.end method
